/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.excesys.exsecs.om.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.excesys.exsecs.common.core.util.R;
import com.excesys.exsecs.om.dto.CheckReportStatisticsDto;
import com.excesys.exsecs.om.dto.CountRepairDto;
import com.excesys.exsecs.om.dto.SheetDto;
import com.excesys.exsecs.om.entity.OmICheckSheet;
import com.excesys.exsecs.om.vo.InspectionVo;
import com.excesys.exsecs.om.vo.SheetVo;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 巡检单
 *
 * @author weiyj
 * @date 2023-03-01 14:10:58
 */
public interface OmICheckSheetService extends IService<OmICheckSheet> {

	/**
	 * 保存巡检单信息
	 * @param sheetDto DTO 对象
	 * @return success/fail
	 */
	Boolean saveSheet(SheetDto sheetDto);

	/**
	 * 修改巡检单信息
	 * @param sheetDto DTO 对象
	 * @return success/fail
	 */
	Boolean updateSheet(SheetDto sheetDto);

	R<Boolean> operateOmICheckSheet(SheetDto sheetDto);

	IPage<SheetVo> getSheetWithRelPage(Page page, OmICheckSheet omICheckSheet, String flag);

	SheetVo getSheetById(Serializable id);

	SheetVo getSheetDetailById(Serializable id);

	SheetVo getSheetDetailByNum(Serializable id);

	Map<String, String> getSheetCountMap(Long userId);

	/**
	 * 修改巡检点 ----- nfc状态
	 * @return success/fail
	 */
	int getUpdateNfcStatus(Map map);

	// 巡检全部状态 - 首页
	List<Map<String, Object>> getAllCheckStatus();

	// 巡检完成率
	List<Map<String, Object>> getCheckFinishingRate();

	Map<String, List<InspectionVo>> getCheckReportStatistics(String flag);

	List<CountRepairDto> getCheckRepairAnalyze();

	List<InspectionVo> listBamSBuildings(String flag);

	List<InspectionVo> listBamSBuildingsByTime(CheckReportStatisticsDto dto);

	Map<String, List<InspectionVo>> getCheckReportStatisticsByDate(CheckReportStatisticsDto dto);

	Map<String, Integer> getSheetNum();

}
